#!/bin/bash
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum update -y
yum install telnet net-tools  epel-release container-selinux -y
sudo yum install -y docker-ce  docker-ce-cli containerd.io
sudo systemctl enable docker.service
mkdir -p /data/docker/data-root
mkdir -p /etc/docker
cat  > /etc/docker/daemon.json << EOF  {"data-root": "/data/docker/data-root","registry-mirrors" : ["https://6zy5kcio.mirror.aliyuncs.com"]}EOF
systemctl enable docker && systemctl restart docker

curl -L https://get.daocloud.io/docker/compose/releases/download/1.28.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose -v